package com.java.cloud.account.service.impl;

import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.java.common.utils.PageUtils;
import com.java.common.utils.Query;

import com.java.cloud.account.dao.AccountDao;
import com.java.cloud.account.entity.Account;
import com.java.cloud.account.service.AccountService;

@Service("accountService")
public class AccountServiceImpl extends ServiceImpl<AccountDao, Account> implements AccountService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<Account> page = this.page(
                new Query<Account>().getPage(params),
                new QueryWrapper<>()
        );

        return new PageUtils(page);
    }

	@Override
	public int decrease(Long userId, BigDecimal money) {
		return this.baseMapper.decrease(userId,money);
	}

}